package types;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ChampMail extends ChampString{

	@Override
	public boolean Check() {
		return CheckMail(this);
	}
	
	public boolean CheckMail(ChampMail c){
		Pattern p = Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$");
		Matcher m = p.matcher(c.valeur.toUpperCase());
		return m.matches();
	}
}
 